<template>
  <div :class="isContract ? 'padding-left-right-25' : ''">
    <div v-if="showTitle" class="font-size-16 font-weight-700 padding-bottom-15 padding-top-15">审批信息</div>
    <el-table :border="true" :data="tableData" :class="newTableStyle ? 'new-table-style' : ''">
      <el-table-column align="center" label="序号" prop="kjine">
        <template slot-scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="处理人" prop="auditorsDesc"></el-table-column>
      <el-table-column align="center" label="处理时间">
        <template slot-scope="scope">
          <span>{{ scope.row.approveTime | formatDateTime('YYYY-MM-DD HH:mm') }}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="处理结果">
        <template slot-scope="scope">
          <span v-if="scope.row.opinionType == 1">审核通过</span>
          <span v-else-if="scope.row.opinionType == 4">审核驳回</span>
          <span v-else>--</span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="意见说明" prop="approvalMessage">
        <template slot-scope="scope">
          <span >{{scope.row.approvalMessage || '--'}}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
  import { apiFlowOption } from '../../api';

  export default {
    props: {
      showTitle: {
        type: Boolean,
        default: true
      },
      isContract: {
        type: Boolean,
        default: false
      },
      newTableStyle: {
        type: Boolean,
        default: false
      },
      workId: {
        type: String,
        default: ''
      },
    },

    data() {
      return { tableData: [] };
    },

    mounted() {
      this.getInfo();
    },

    methods: {
      async getInfo() {
        let param = { businessKey: this.$route.query.processWorkId || this.workId };
        let res = await apiFlowOption(param);
        this.tableData = res.rows || [];
      },
    },
  };
</script>
<style lang="scss" scoped></style>
